Tcncv, yes, I'm familiar with external sorting, I'm primarily wondering how to do the internal phase.
2.
I have 100's of billions ( maybe trillions ) of records and will be doing this operation a lot, and anyway I'm interested in general in how the " big boys " approach sorting now that everything is going multicore . 100's of millions is just for the internal phase.
3.
Recently Couder, Fort, " et al . " showed that we can use macroscopic oil droplets on a vibrating surface as a model of wave particle duality localized droplet creates periodical waves around and interaction with them leads to quantum-like phenomena : interference in double-slit experiment, unpredictable tunneling ( depending in complicated way on practically hidden state of field ), orbit quantization ( that particle has to'find a resonance'with field perturbations it creates after one orbit, its internal phase has to return to the initial state ) and Zeeman effect.